<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ include file="lib.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>京西</title>
  <link rel="stylesheet" type="text/css" href="css/index.css" />

</head>
<body bgcolor="#F0F8FF">
<div class="page">
  <div>
    <br>
  </div>
  <ul id="jsddm">
    <li>
     <a href="../index/index.jsp">首页</a>
    </li>
    <li onmouseover="showSubMenu(this)" onmouseout="hideSubMenu(this)">
      <a>商品分类</a>
            <ul>
                <li><a href="../index/showGoodsByType?typeid=101">服饰</a></li>
                 <li><a href="../index/showGoodsByType?typeid=102">食品</a></li>
                  <li><a href="../index/showGoodsByType?typeid=103">书籍</a></li>
                   <li><a href="../index/showGoodsByType?typeid=104">科技</a></li>
                    <li><a href="../index/showGoodsByType?typeid=105">日用</a></li>
            </ul>
    </li>
    <li onmouseover="showSubMenu(this)" onmouseout="hideSubMenu(this)">
    	<a href="../user/showcar">我的购物车</a>

    </li>
    <li>
            <a href="../user/showorder">我的订单</a>
    </li>
    <li onmouseover="showSubMenu(this)" onmouseout="hideSubMenu(this)">
      	<a >个人中心</a>
		<ul>
			<li><a href="../user/cusindex.jsp">个人中心</a></li>
			<li><a href="../user/logout">退出登录</a></li>
		</ul>
    </li>
    <li>
		<form action="../index/searchgoods" method="post">
			<input type="text" name="find_goods" placeholder="请输入商品名" style="width: 100px;height: 30px;border:1px solid #000000;">
			<input type="submit" name="submit" value="搜索" style="border:1px solid #000000;width: 40px;height: 25px">
		</form>
    </li>
  </ul>
  <script type="text/javascript">
    //显示子菜单
    function showSubMenu(li){
      var subMenu = li.getElementsByTagName("ul")[0];
      subMenu.style.display = "block";
    }

    //隐藏子菜单
    function hideSubMenu(li){
      var subMenu = li.getElementsByTagName("ul")[0];
      subMenu.style.display = "none";
    }
  </script>

  <div class="content">
    <div class="zuo">

      <!---------------------------------------------------↓ 热销接口 ↓--------------------------------->
            <div class="fangshi">
                <h1>热销榜</h1>
                <br>&nbsp;
              <% int i=1; %>
                <c:forEach items="${goodsList_sales}" var="vo">
                	<a href="../goods/byPage?gid=${vo.gid}"> 
                	<img src="images/1.<% out.print(i++);%>.jpg">  ${vo.gname}
                	</a><br><br>&nbsp;
                </c:forEach>
            </div>
      <!---------------------------------------------------↑ 热销接口 ↑--------------------------------->

      <br>

      <!---------------------------------------------------↓ 热搜接口 ↓--------------------------------->
             <div class="fangshi">
                <h1>热搜榜</h1>
                <br>&nbsp;
              <% i=1; %>
                <c:forEach items="${goodsList_search}" var="vo">
                	<a href="../goods/byPage?gid=${vo.gid}"> 
                	<img src="images/1.<% out.print(i++);%>.jpg">  ${vo.gname}
                	</a><br><br>&nbsp;
                </c:forEach>
            </div>
      <!---------------------------------------------------↑ 热搜接口 ↑--------------------------------->

      <br>

      <!---------------------------------------------------↓ 猜你喜欢接口 ↓--------------------------------->
            <div class="fangshi">
                <h1>猜你喜欢</h1>
                <br>&nbsp;
                <% i=1; %>
                <c:forEach items="${goodsList_clike}" var="vo">
                	<a href="../goods/byPage?gid=${vo.gid}">
                	<img src="images/1.<% out.print(i++);%>.jpg">   ${vo.gname}
                	</a><br><br>&nbsp;
                </c:forEach>
                <br><br>
            </div>
      <!---------------------------------------------------↑ 猜你喜欢接口 ↑--------------------------------->

      <br>
    </div>
    <div class="you">
      <div class="clearit"></div>

      <!---------------------------------------------------↓ 首页随机接口 ↓--------------------------------->
      <!-------------for循环生成div i<=(list.size()+1)/2 ---------------->
		<%i=2; %>
			<div class="zhuanti">
					<br>
				<c:forEach items="${goodsList}" var="vo">
	              	<div class="zhuanti<%if(i==1) i=2;else if(i==2) i=1;out.print(i);%>">
    	        		<br>
        	    		<a href="../goods/byPage?gid=${vo.gid}"> 
        	    		<img src="../img/${vo.picture}" height="200" width="200"></a>
        	    		<a href="../goods/byPage?gid=${vo.gid}"><p class="goodsname">${vo.gname}</p></a>
        	    		<a href="../goods/byPage?gid=${vo.gid}"><p class="goodsprice">${vo.gprice}</p></a>
        	    		<br>
            		</div>
                    <%if(i==2)out.print("<div class=\"clearit\"><br></div>"); %>
            	</c:forEach>
                <div class="clearit"></div>
            </div>

      <!---------------------------------------------------↑ 首页随机商品接口 ↑--------------------------------->

    </div>
    <br>
    <div class="clearit"></div>

  </div>
</div>
<div>
  <p class="banquan">&nbsp;</p>
  <p class="banquan">版权所有：刘艺杰、安森泰、张恒超、卢晓丹、贾文婷 2021-现在</p>
  <a href="mailto:2629145453@qq.com"><p class="banquan">联系我们</p></a>
  <p class="banquan">&nbsp;</p>
</div>

</body>
</html>
